package design.patterns.commandmodel.audioplayerdemo;

/**
 * @Desc:   Invoker 角色
 * @author: cww
 * @DateTime: 2020-06-13 10:42
 */

public class Keypad {
    private Command playCmd;
    private Command rewindCmd;
    private Command stopCmd;

    public Keypad(Command playCmd, Command rewindCmd, Command stopCmd) {
        this.playCmd = playCmd;
        this.rewindCmd = rewindCmd;
        this.stopCmd = stopCmd;
    }

    /**
     *  行动方法
     */
    public void play() {
        playCmd.execute();
    }

    /**
     * 行动方法
     */
    public void stop() {
        stopCmd.execute();
    }
}
